package com.yfp.client.service.impl.couponStrategy;

import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class ClientCouponStrategyFactory {

    @Resource
    private Map<String, ClientCouponStrategy> clientCouponStrategyMap;

    public ClientCouponStrategy getClientCouponStrategy(Integer strategy) {
        // 1满减2折扣
        switch (strategy) {
            case 1:
                return clientCouponStrategyMap.get("fullReductionClientCouponStrategy");
            case 2:
                return clientCouponStrategyMap.get("percentageDiscount");
            default:
                return null;
        }
    }
}
